package com.wlm.service.impl;

import com.wlm.dao.DoorMapper;
import com.wlm.pojo.Door;
import com.wlm.service.DoorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DoorServiceImpl implements DoorService {

    @Resource
    private DoorMapper doorMapper;
    @Override
    public List<Door> findDoors() {
        return doorMapper.findDoors();
    }

    @Override
    public Door findDoorById(Integer id) {
        return doorMapper.findDoorById(id);
    }

    @Override
    public boolean addDoor(Door door) {
        return doorMapper.insertDoor(door) > 0;
    }

    @Override
    public boolean updateDoor(Door door) {
        return doorMapper.updateDoor(door) > 0;
    }

    @Override
    public boolean removeDoorById(Integer id) {
        return doorMapper.removeDoorById(id) > 0;
    }
}
